#tag Window
Begin Window Window1
   BackColor       =   16777215
   Backdrop        =   ""
   BalloonHelp     =   ""
   CloseButton     =   True
   Composite       =   False
   Frame           =   0
   FullScreen      =   False
   HasBackColor    =   False
   Height          =   300
   ImplicitInstance=   True
   LiveResize      =   False
   MacProcID       =   0
   MaxHeight       =   32000
   MaximizeButton  =   True
   MaxWidth        =   32000
   MenuBar         =   1931845631
   MenuBarVisible  =   True
   MinHeight       =   64
   MinimizeButton  =   True
   MinWidth        =   64
   Placement       =   0
   Resizeable      =   True
   Title           =   "TwainTest2006"
   Visible         =   True
   Width           =   252
   Begin GroupBox GroupBox1
      AutoDeactivate  =   True
      Bold            =   ""
      Caption         =   "Acquire"
      Enabled         =   True
      Height          =   80
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   11
      LockBottom      =   True
      LockLeft        =   False
      LockRight       =   True
      LockTop         =   ""
      Scope           =   0
      TabIndex        =   0
      TabPanelIndex   =   0
      TextFont        =   "System"
      TextSize        =   0
      Top             =   211
      Underline       =   ""
      Visible         =   True
      Width           =   113
      BehaviorIndex   =   0
      Begin RadioButton nativeButton
         AutoDeactivate  =   True
         Bold            =   ""
         Caption         =   "Native"
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "GroupBox1"
         Italic          =   ""
         Left            =   25
         LockBottom      =   False
         LockLeft        =   False
         LockRight       =   ""
         LockTop         =   ""
         Scope           =   0
         TabIndex        =   0
         TabPanelIndex   =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   225
         Underline       =   ""
         Value           =   True
         Visible         =   True
         Width           =   60
         BehaviorIndex   =   1
      End
      Begin RadioButton clipButton
         AutoDeactivate  =   True
         Bold            =   ""
         Caption         =   "To Clipboard"
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "GroupBox1"
         Italic          =   ""
         Left            =   25
         LockBottom      =   False
         LockLeft        =   False
         LockRight       =   ""
         LockTop         =   ""
         Scope           =   0
         TabIndex        =   1
         TabPanelIndex   =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   244
         Underline       =   ""
         Value           =   ""
         Visible         =   True
         Width           =   83
         BehaviorIndex   =   2
      End
      Begin RadioButton fileButton
         AutoDeactivate  =   True
         Bold            =   ""
         Caption         =   "To File"
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "GroupBox1"
         Italic          =   ""
         Left            =   25
         LockBottom      =   False
         LockLeft        =   False
         LockRight       =   ""
         LockTop         =   ""
         Scope           =   0
         TabIndex        =   2
         TabPanelIndex   =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   264
         Underline       =   ""
         Value           =   ""
         Visible         =   True
         Width           =   60
         BehaviorIndex   =   3
      End
   End
   Begin PushButton PushButton2
      AutoDeactivate  =   True
      Bold            =   ""
      Cancel          =   ""
      Caption         =   "Source"
      Default         =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   151
      LockBottom      =   True
      LockLeft        =   False
      LockRight       =   True
      LockTop         =   ""
      Scope           =   0
      TabIndex        =   1
      TabPanelIndex   =   0
      TextFont        =   "System"
      TextSize        =   0
      Top             =   223
      Underline       =   ""
      Visible         =   True
      Width           =   80
      BehaviorIndex   =   4
   End
   Begin PushButton PushButton1
      AutoDeactivate  =   True
      Bold            =   ""
      Cancel          =   ""
      Caption         =   "Acquire"
      Default         =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   152
      LockBottom      =   True
      LockLeft        =   False
      LockRight       =   True
      LockTop         =   ""
      Scope           =   0
      TabIndex        =   2
      TabPanelIndex   =   0
      TextFont        =   "System"
      TextSize        =   0
      Top             =   260
      Underline       =   ""
      Visible         =   True
      Width           =   80
      BehaviorIndex   =   5
   End
   Begin Canvas Canvas1
      AcceptFocus     =   ""
      AcceptTabs      =   ""
      AutoDeactivate  =   True
      Backdrop        =   ""
      Enabled         =   True
      EraseBackground =   True
      Height          =   195
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Left            =   4
      LockBottom      =   True
      LockLeft        =   True
      LockRight       =   True
      LockTop         =   True
      Scope           =   0
      TabIndex        =   3
      TabPanelIndex   =   0
      Top             =   4
      UseFocusRing    =   True
      Visible         =   True
      Width           =   244
      BehaviorIndex   =   6
   End
End
#tag EndWindow

#tag WindowCode
#tag EndWindowCode

#tag Events PushButton2
	#tag Event
		Sub Action()
		  Dim f As FolderItem
		  Dim tw As New sjgEZTwain
		  
		  If tw.SelectSource Then
		    MsgBox tw.classVersion
		  Else
		    MsgBox  tw.lastError
		  End If
		End Sub
	#tag EndEvent
#tag EndEvents
#tag Events PushButton1
	#tag Event
		Sub Action()
		  Dim f As FolderItem
		  Dim tw As New sjgEZTwain
		  
		  If nativeButton.Value Then
		    If tw.AcquireNative Then
		      Canvas1.Backdrop = tw.pic
		    Else
		      MsgBox tw.lastError
		    End If
		    
		  Elseif clipButton.Value Then
		    If tw.AcquireToClipboard Then
		      MsgBox "Picture now on Clipboard"
		    Else
		      MsgBox tw.lastError
		    End If
		    
		  Else  // fileButton.Value
		    f = TemporaryFolder.child("sjgtest.bmp")
		    If tw.AcquireToFile(f) Then
		      f.Launch
		    Else
		      MsgBox tw.lastError
		    End If
		    
		  End If
		End Sub
	#tag EndEvent
#tag EndEvents
